<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="<?php echo CHARSET;?>">
<title>本地生活</title>
<link href="/Public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile"/>
<script type="text/javascript" src="/Public/static/jquery.js"></script>
<script type="text/javascript" src="/Public/static/jquery.validation.min.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Public/admin/js/admincp.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.tooltip.js"></script>
<script language="javascript">
var SiteUrl = '<?php echo (C("SiteUrl")); ?>';
var AdminUrl = SiteUrl+'/<?php echo (MODULE_NAME); ?>';
</script>
</head><body>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>外链管理</h3>
      <ul class="tab-base">
        <li><a href="JavaScript:void(0);" class="current"><span>管理</span></a></li>
        <li><a href="<?php echo U('Setting/links_add');?>" ><span>添加</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="post" id="form_admin" action="<?php echo U('Setting/links');?>">
    <table class="table tb-type2">
      <thead>
        <tr class="thead">
          <th>排序</th>
          <th>外链名称</th>
          <th>外链地址</th>
          <th>外链Logo</th>
          <th class="align-center">状态</th>
          <th class="align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="hover">
           <td class="w48 sort"><span title="可编辑" ajax_branch="link_sort" datatype="number" fieldid="<?php echo ($vo['link_id']); ?>" ajax_control="Setting" fieldname="links" nc_type="inline_edit" class="editable tooltip"><?php echo ($vo['link_sort']); ?></span></td>
          <td><?php echo ($vo['link_name']); ?></td>
          <td><?php echo ($vo['link_url']); ?></td>
          <td><img src="/Uploads//<?php echo ($vo['link_image']); ?>" width="50" /></td>
		  <td class="align-center yes-onoff">
          <?php if($vo['link_status'] == 1): ?><a href="JavaScript:void(0);" class="tooltip enabled" ajax_control="Setting" ajax_branch='links' nc_type="inline_edit" fieldname="link_status" fieldid="<?php echo ($vo['link_id']); ?>" fieldvalue="1" title="启用">	<img src="/Public/admin/images/transparent.gif"></a>

          <?php else: ?>
            <a href="JavaScript:void(0);" class="tooltip disabled" ajax_control="Setting" ajax_branch='links' nc_type="inline_edit" fieldname="link_status" fieldid="<?php echo ($vo['link_id']); ?>" fieldvalue="0" title="关闭"><img src="/Public/admin/images/transparent.gif"></a><?php endif; ?>
         </td>
          <td class="w150 align-center">
			<a href="<?php echo U('Setting/links_edit',array('link_id'=>$vo['link_id']));?>">编辑</a>
            &nbsp;|&nbsp;
            <a href='javascript:if(confirm("您确定要删除吗？"))window.location="<?php echo U('Setting/links_del',array('link_id'=>$vo['link_id']));?>";'>删除</a>
          </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
      </tbody>
      <tfoot>
        <tr class="tfoot">
        <td colspan="16"></td>
        </tr>
      </tfoot>      
    </table>
  </form>
</div>
<script type="text/javascript" src="/Public/admin/js/jquery.edit.js" charset="utf-8"></script> 
</body></html>